package org.xg.study.boot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.xg.study.boot.common.ajax.ResultData;
import org.xg.study.boot.common.utils.ResultUtil;
import org.xg.study.boot.entity.Person;

/**
 * @author CMG
 * @version 1.0
 * @description
 * @cLassName PersonController
 * @date 2021/10/9 13:42
 **/
@RestController
@CrossOrigin
@RequestMapping("/person")
@Api(tags = "Person接口列表")
public class PersonController {
    private final Person person;

    public PersonController(Person person) {
        this.person = person;
    }

    @RequestMapping(value = "/get", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "测试SpringBoot读取自定义配置")
    public ResultData<Person> hello(){
        return ResultUtil.success(person);
    }
}
